/* 
   Hex-Reinforced Design System
   Core Variables & Global Styles
*/

:root {
  /* Primary */
  --hex-blue: #3b82f6;
  --hex-glow: rgba(59, 130, 246, 0.5);

  /* Backgrounds */
  --dark-bg: #0f172a;
  --panel-bg: rgba(15, 23, 42, 0.95);
  --panel-bg-solid: #020617;

  /* Borders & Dividers */
  --border-color: #475569;
  --border-light: rgba(255, 255, 255, 0.15);

  /* Text */
  --text-main: #ffffff;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;

  /* Accent Colors */
  --accent-green: #10b981;
  /* Positive, online, success */
  --accent-red: #ef4444;
  /* Negative, error, offline */
  --accent-orange: #f59e0b;
  /* Warning, attention */
  --accent-purple: #8b5cf6;
  /* Alternate highlight */
  --accent-cyan: #06b6d4;
  /* Info, secondary action */
  --accent-pink: #ec4899;
  /* Tertiary accent */

  /* Fonts */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', 'Monaco', monospace;
}

/* Global Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--dark-bg);
  color: var(--text-main);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;

  /* Grid Background Pattern */
  background-image:
    radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1), transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
}

/* Typography Classes */
.heading-xl {
  font-family: var(--font-ui);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
}

.heading-lg {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.heading-md {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.heading-sm {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.body-lg {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.body-md {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.body-sm {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.body-xs {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}

.data-xl {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
}

.data-lg {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
}

.data-md {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 500;
}

.data-sm {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
}

/* Utility Classes */
.text-main {
  color: var(--text-main);
}

.text-muted {
  color: var(--text-muted);
}

.text-dim {
  color: var(--text-dim);
}

.text-blue {
  color: var(--hex-blue);
}

.text-green {
  color: var(--accent-green);
}

.text-red {
  color: var(--accent-red);
}

.text-orange {
  color: var(--accent-orange);
}

.font-mono {
  font-family: var(--font-mono);
}

.uppercase {
  text-transform: uppercase;
}

/* Hex Mesh Overlay */
.hex-mesh {
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='34' viewBox='0 0 20 34' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 0l10 5.77v11.55L10 23.1 0 17.32V5.77L10 0zm0 34l-10-5.77V16.68l10 5.77 10-5.77v11.55L10 34z' fill='%233b82f6' fill-opacity='0.03'/%3E%3C/svg%3E");
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--hex-blue);
  outline-offset: 4px;
}

/* --- POI MANAGER DRAWER --- */
#poi-drawer {
  position: fixed;
  left: 64px;
  /* After nav dock */
  top: 60px;
  /* After header */
  width: calc(100vw - 64px);
  /* Full width */
  height: calc(100vh - 60px);
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 45;
  /* Above tools drawer (30) but below modals (100) */
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

#poi-drawer.open {
  transform: translateX(0);
}

.poi-drawer-header {
  padding: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.poi-stats-row {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.poi-stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 12px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.poi-stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  display: block;
}

.poi-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.poi-groups-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 3 Groups per row */
  gap: 24px;
  align-content: start;
  /* Prevent stretching */
}

/* POI Group Card */
.poi-group-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  height: 500px;
  /* Fixed height for consistency in grid */
  display: flex;
  flex-direction: column;
}

.poi-group-card:hover {
  border-color: var(--hex-blue);
  background: rgba(255, 255, 255, 0.04);
}

/* Elongated Hex Header */
.hex-header-elongated {
  padding: 12px 32px;
  /* Increased side padding for hex points */
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  /* True Elongated Hexagon Shape (Pointy Ends) */
  clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 50%, calc(100% - 15px) 100%, 15px 100%, 0 50%);
  margin-bottom: 1px;
  /* Visual separation */
}

.poi-group-header .header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.poi-group-header .group-name {
  font-weight: 600;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.poi-group-header .group-count {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
}

.poi-list {
  min-height: 60px;
  padding: 12px;
  /* Functional Scalability: Scrollable list */
  overflow-y: auto;
  flex: 1;
  /* Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--hex-blue) transparent;
}

.poi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 2px solid transparent;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.poi-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--hex-blue);
  /* Visual Scalability: Scale up on hover */
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.poi-item .poi-name {
  font-size: 13px;
  color: var(--text-muted);
}

.poi-item .poi-count-badge {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.icon-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.icon-btn:hover {
  color: white;
}